<?php
namespace haibao\cms\business\behavior;

class CustomStatistic extends \haibao\cms\business\Base{
	
	public static function addCustomStatistic($model){
		if(!$model->CustomCode){
			throw new \haibao\cms\business\BusinessException("自定义选项不能为空",self::DATA_EMPTY_FUNCTION_CODE);
		}
		$data = new \haibao\cms\data\behavior\CustomStatistic();
		$model->Uid = self::getCurrentUser()->Id;
		$data->add($model);
	}
	
	public static function getCustomCode($filter){
		$data = new \haibao\cms\data\behavior\CustomStatistic();
		return $data->getOne($filter);
	}
	
	public static function getAllCustom($filter){
		$data = new \haibao\cms\data\behavior\CustomStatistic();
		return $data->getAll($filter);
	}
	
	public static function updateCustomById($id, $arrSet){
		$data = new \haibao\cms\data\behavior\CustomStatistic();
		$data->updateById($id, $arrSet);
	}
	
}